﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;

namespace Fast.NormalizeActionResult
{
    public interface IActionResultProvider
    {
        /// <summary>
        /// 获取异常结果
        /// </summary>
        /// <param name="context"></param>
        /// <param name="metadata"></param>
        /// <returns></returns>
        IActionResult GetExceptionResult(ExceptionContext context, ExceptionMetadata metadata);

        /// <summary>
        /// 获取成功结果
        /// </summary>
        /// <param name="context"></param>
        /// <param name="data"></param>
        /// <returns></returns>
        IActionResult GetSucceededResult(ActionExecutedContext context, object data);

        /// <summary>
        /// 获取验证失败结果
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        IActionResult GetValidateFailedResult(ActionExecutingContext context, ValidationMetadata metadata);
    }
}
